// offer相关的接口函数
import request from '@/utils/http.js'

//1.添加offer
export const addOfferAPI=(data) =>{
    return request({
        url: '/offer/addOffer',
        method: 'post',
        data:{
            offerStudentId:data.offerStudentId,
            offerJobId:data.offerJobId,
            offerEnterpriseId:data.offerEnterpriseId,
            offerStatus:data.offerStatus,
            offerSupplementaryInformation:data.offerSupplementaryInformation,
            offerExpirationDate:data.offerExpirationDate,
        }
    })
}
//2.分页获取offer
export const pageOfferAPI=(data) =>{
    return request({
        url: '/offer/pageOffer',
        method: 'post',
        data:{
            offerStudentId:data.offerStudentId,
            offerStatus:data.offerStatus,
            offerEnterpriseId:data.offerEnterpriseId,
        }
    })
}
//3.修改offer
export const updateOfferByIdAPI=(data) =>{
    return request({
        url: '/offer/updateOfferById',
        method: 'post',
        data:{
            offerId:data.offerId,
            offerStatus:data.offerStatus,
        }
    })
}
//4.查询offerById信息
export const queryOfferByIdAPI=(offerId) =>{
    return request({
        url: '/offer/queryOfferById',
        method: 'post',
        params:{offerId}
    })
}
//5.查询学生offer数量ByStudentId
export const queryOfferCountByStudentIdAPI=(studentId) =>{
    return request({
        url: '/offer/queryOfferCountByStudentId',
        method: 'post',
        params:{studentId}
    })
}
//6.查询企业Offer数量ByEnterpriseId
export const queryOfferCountByEnterpriseIdAPI=(enterpriseId) =>{
    return request({
        url: '/offer/queryOfferCountByEnterpriseId',
        method: 'post',
        params:{enterpriseId}
    })
}
//7.学生删除offer
export const deleteOfferByStudentAPI=(offerId,studentId) =>{
    return request({
        url: '/offer/deleteOfferByStudent',
        method: 'post',
        params:{
            offerId:offerId,
            studentId:studentId}
    })
}
//8.企业删除offer
export const deleteOfferByEnterpriseAPI=(offerId,enterpriseId) =>{
    return request({
        url: '/offer/deleteOfferByEnterprise',
        method: 'post',
        params:{
            offerId:offerId,
            enterpriseId:enterpriseId
        }
    })
}